package com.hippomeetsskunk.savanna.types.world;

public class ClimaCurve {
	private double yearAverage;
	private double yearDifference;
	private double timeShift;

	public ClimaCurve(double yearAverage, double yearDifference, double timeShift){
		this.yearAverage = yearAverage;
		this.yearDifference = yearDifference;
		this.timeShift = timeShift;
	}
	
	public double getValue(Time time){
		return yearDifference * 0.5 * (Math.sin(2 * (time.getYearFraction() + timeShift) * Math.PI) + 1) + (yearAverage - 0.5 * yearDifference);
	}
}
